<?php
    session_start();		
    //ob_start();
    //ob_end_flush();
    include('class.mysql.php');
    $mydb = new mysql();
    $connection = $mydb->Connect();
    //Menghitung jumlah KK terdaftar
    $sql="SELECT COUNT(*) FROM login ";
    //echo "$sql";	
    $query = $mydb->Query($sql);
    $num = $mydb->FetchNum($query);
    //$kabupaten[]="Pilih kota2";
    $ssign="usr";
    $access = "grant";
    $nuptk=$_SESSION["SES_USERNAME"];
    $ses_prop=$_SESSION["SES_PROP"];
    $ses_type=$_SESSION["SES_TYPE"];
    if($nuptk=="admin")
        $ssign="adm";
    if($array= mysql_fetch_row($query))
    {
	$jumlah_total_kk=$array[0];
    }//end
    //Mengambil data reg_no login
    $nuptk = $_SESSION["SES_USERNAME"];
    /*Mengecek aktif user, jika admin, maka, menu pengaturan admin diaktifkan*/
    if ($nuptk=="admin")
        $additional_menu = '<li class="last"><a href="lihat_pesan.php">Pengaturan Pesan Admin</a></li>';
    else
    {
    	  $sql="SELECT pesan10,pesan9 FROM admin where username='$nuptk'";
		    //echo "$sql";	
		    $query = $mydb->Query($sql);
		    $num = $mydb->FetchNum($query);
		    //$kabupaten[]="Pilih kota2";
		    if($array= mysql_fetch_row($query))
        {
						$additional_menu = '<li class="last"><a href="lihat_pesan.php">Pengaturan Pesan Admin</a></li>';       
						$ssign="adm"; 
						$nama_kkadm = $array[1];
			  }    
    }	
    if($nuptk!="")
    {
        $sql="SELECT no_reg FROM login where nuptk='$nuptk'";
        //echo "$sql";	
        $query = $mydb->Query($sql);
        $num = $mydb->FetchNum($query);
        //$kabupaten[]="Pilih kota2";
        if($array= mysql_fetch_row($query))
        {
	          $reg_no=$array[0];
        }//end
    }
    else
        $reg_no="X";
    $target_file = "show_data.php";    
    //Mengambil nama KK
    if($nuptk!="")
    {
        $sql="SELECT nama_kk FROM identitas where no_reg='$reg_no'";
        //echo "$sql";	
        $query = $mydb->Query($sql);
        $num = $mydb->FetchNum($query);
        //$kabupaten[]="Pilih kota2";
        if($array= mysql_fetch_row($query))
        {
	          $nama_kk=$array[0];
        }//end
        else
            $nama_kk="Belum login";
        if ($ssign=="adm")
        {
        	  if($nuptk=="admin")
                $nama_kk="Administrator";
            else 
            {
                $nama_kk=$nama_kkadm;
                $ses_prop=$_SESSION["SES_PROP"];
                $sprop=$_GET["prop"];
							  if($sprop!=$ses_prop)
							      $access = "block"; 
          	}
            $button_list = '<tr><td colspan="4" align="center">
                <div id="contact-form">
                <input type="button" name="pilih_semua" value="Pilih Semua" onclick="PilihSemua();"/>
			          <input type="button" name="reset_pilihan" value="Reset Pilihan" onclick="ResetPilihan();"/>
			          <input type="button" name="filter_table" value="Filter Tabel" onclick="FilterTable();"/>
			          <input type="button" name="simpan" value="Download Excel Table" onclick=CreateExcelSheet("filter"); />
			          <input type="button" name="simpan" value="Download All Data" onclick=CreateExcelSheet("all"); />			          
			          <input type="button" name="contact" value="Filter Kolom" class="contact demo" id="contact-form"/>
			          </div>
			          </td></tr>';
        }
        else
        {
            $target_file = "show_data_mb.php";	
        		$access = "block";
        }
        $img_log="images/sign_out.png";
    }
    else if ($nama_kk=="")
    {
        $access = "block";
        $target_file = "show_data_mb.php";
        $nama_kk="Belum login";
        $img_log="images/sign_in.png";
    }
    $sprop=$_GET["prop"];
    if($sprop=="")
        $sprop="XX";
    $skab=$_GET["kab"];
    if ($skab=="")
        $skab="XX";
    $skk=$_GET["tipe_kk"];
    if ($skk=="")
        $skk="XX";
?>

<script type="text/javascript" >
var oInterval;
var oInterval2;
var oInterval3;
var oInterval4;
var oInterval5;
var oInterval6;
var oInterval7;
var iflag1=0,iflag2=0;
var istartup=1;
//
var datatemp="<?php echo $access?>";
if (datatemp=="block")
{
	  alert("Maaf, anda tidak dapat mengakses halaman ini");
    location = "ptampil_data.php";
}
//
function wait(msecs)
{
    var start = new Date().getTime();
    var cur = start
    while(cur - start < msecs)
    {
        cur = new Date().getTime();
    }
}
function UpdateCombo(kode_prop,kode_kab,kode_kk)
{
    if (document.Inputdata.combo_kota !== undefined && document.Inputdata.propinsi !== undefined && document.Inputdata.combo_kk !== undefined)
    {
        document.Inputdata.combo_kota.value=kode_kab;
        document.Inputdata.combo_kk.value=kode_kk;
	document.Inputdata.propinsi=kode_prop;
	window.clearInterval(oInterval6);
    }
}
function showrekapnasional(kode_prop,kode_kab,kode_kk)
{
   
    var data;
    //alert(kode_kab);
    document.Inputdata.loading_logo.src="images/loading.gif";
    window.clearInterval(oInterval3);
    //alert(kode_kab);
    //window.alert("masuk");
    var ses_login=getCookie("login");
    var ses_prop=getCookie("lctaxdm");
    if((ses_prop!=kode_prop)&&ses_login!="admin")
    {
	     alert("Maaf, anda tidak dapat mengakses halaman ini");
       location = "ptampil_data.php";
    }   
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp6=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp6=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp6.onreadystatechange=function()
      {
      if (xmlhttp6.readyState==4 && xmlhttp6.status==200)
        {
        document.getElementById("rekapnas").innerHTML=xmlhttp6.responseText;
        }
      }
    if (iflag2==0)
    {
        kode_prop = "<?php echo $sprop?>";
        kode_kab = "<?php echo $skab ?>";
        kode_kk = "<?php echo $skk ?>";  
        oInterval6=window.setInterval('UpdateCombo("'+kode_prop+'","'+kode_kab+'","'+kode_kk+'")', 1000);

    }
    if (kode_prop=="XX")
        kode_prop = "";
    if (kode_kab=="XX")
        kode_kab = "";
    if (kode_kk=="XX")
        kode_kk = "";
    var data2;
    //alert(kode_kab);
    var kode_kec = "";
    if(kode_kab!=""&&iflag2!=0)
        kode_kec = document.Inputdata.combo_kecamatan.value;
    var tipe_daerah = document.Inputdata.combo_tipe_daerah.value;
    data2 = "<?php echo $target_file ?>"+"?prop="+kode_prop+"&kab="+kode_kab+"&tipe_kk="+kode_kk+"&kec="+kode_kec+"&daerah="+tipe_daerah;
    //alert(data2);
    xmlhttp6.open("GET",data2,true);
    xmlhttp6.send();
    iflag2=1;
    oInterval7=window.setInterval('fcheckStatTab()', 1000);
}
function desrekapnas()
{
     if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp6=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp6=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp6.onreadystatechange=function()
      {
      if (xmlhttp6.readyState==4 && xmlhttp6.status==200)
        {
        document.getElementById("rekapnas").innerHTML=xmlhttp6.responseText;
        }
      }
    xmlhttp6.open("GET","null.php",true);
    xmlhttp6.send();
}
function showlistkota(str)
{
    var data;
    if (str.length==0)
      {
      document.getElementById("listkota2").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        document.getElementById("listkota2").innerHTML=xmlhttp.responseText;
        }
      } 
    xmlhttp.open("GET","listkota.php?q="+str,true);
    xmlhttp.send();
    oInterval4=window.setInterval('showlistkota_t("'+str+'")', 1000);
}
function showlistkota_t(str)
{
    window.clearInterval(oInterval4);
    if(str!="XX")
    {
        //update list kk
        var sprop=document.Inputdata.propinsi.value;
        if (sprop=="XX")
            sprop="";
        var skab=document.Inputdata.combo_kota.value;
        //if(skab=="XX")
        skab=""; //dikosongi setelah memilih propinsi
        var skk=document.Inputdata.combo_kk.value;
        if(skk=="XX")
            skk="";
        if (istartup!=1)
        {
            desrekapnas();
            setTimeout('showrekapnasional("'+sprop+'","'+skab+'","'+skk+'")',1000);
        }
        //update_retprop(str);
        //data = document.Inputdata.no_registrasi.value;
        //data = data.substring(0,12)+'XXX';
        //document.Inputdata.no_registrasi.value=data;
    }
}
function showlistkecamatan(str)
{
    var data;
    //window.alert(str);
    if (str.length==0)
      {
      document.getElementById("listkecamatan").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp7=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp7=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp7.onreadystatechange=function()
      {
      if (xmlhttp7.readyState==4 && xmlhttp7.status==200)
        {
        document.getElementById("listkecamatan").innerHTML=xmlhttp7.responseText;
        }
      }
    var skab="";
    var sprop="";
    var skk="";
    if(iflag2==0)
    {
        skab="<?php echo $skab?>";
        sprop="<?php echo $sprop?>";
        skk="<?php echo $skk?>";
    }
    else
    {
        skab=document.Inputdata.combo_kota.value; 
        sprop=document.Inputdata.propinsi.value;
        skk="XX";//document.Inputdata.combo_kk.value;
    }
    if(str!="XX")
    {
        xmlhttp7.open("GET","listkecamatan.php?q="+str+"&prop="+sprop+"&kab="+skab,true);
    }
    else
    {
        xmlhttp7.open("GET","listkecamatan.php?q="+str,true);
    }
    xmlhttp7.send();   
    if (istartup!=1)
    {
       desrekapnas();
       setTimeout('showrekapnasional("'+sprop+'","'+skab+'","'+skk+'")',1000);;
		}
}
function showlistpropinsi(str)
{
    //window.alert(str);
    if (str.length==0)
      {
      document.getElementById("listpropinsi").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp2=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp2.onreadystatechange=function()
      {
      if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
        {
        document.getElementById("listpropinsi").innerHTML=xmlhttp2.responseText;
        }
      }
    xmlhttp2.open("GET","listprop.php?q="+str,true);
    xmlhttp2.send();
    if(iflag2==0)
    {
        if (str=='XX')
            str='"XX"';
        oInterval5=window.setInterval('update_prop_show('+str+')', 1000);
    }
    //XX-XX-X-XXX
    //ChangeNoReg_updatelist("XX")
}
function update_prop_show(str)
{
    //alert(str);
    if (str<10)
        str="0"+str;
    document.Inputdata.propinsi.value=str;
    window.clearInterval(oInterval5);
    //alert("abc1");
}
function showlistbidang(str)
{
    //window.alert(str);
    if (str.length==0)
      {
      document.getElementById("listbidang").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp3=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp3=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp3.onreadystatechange=function()
      {
      if (xmlhttp3.readyState==4 && xmlhttp3.status==200)
        {
        document.getElementById("listbidang").innerHTML=xmlhttp3.responseText;
        }
      }
    xmlhttp3.open("GET","listbidang.php?q="+str,true);
    xmlhttp3.send();
    //ChangeNoReg_updatelist("XX")

}
function setCookie(c_name,value,exdays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name)
{
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++)
	  {
	  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
	  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
	  x=x.replace(/^\s+|\s+$/g,"");
	  if (x==c_name)
	    {
	    return unescape(y);
	    }
	  }
}

function show_status_penyimpanan()
{
    var str,noreg_u;
    str=getCookie("s_simpan");
    if (str!="0" && str!="")
    {
        //alert(str);
        if(str!="GAGAL")
        {
            alert("Terima kasih, data anda telah berhasil disimpan");
            window.location='view.php?reg='+str;
        }
        else
            alert("Data gagal disimpan, mohon perbaiki data anda");
	window.clearInterval(oInterval2);
	setCookie("s_simpan","0",1);
        window.location='#';
    }    
}
function saveDB(str)
{
    //alert("hhhh");
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp5=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp5=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp5.onreadystatechange=function()
      {
      if (xmlhttp5.readyState==4 && xmlhttp5.status==200)
        {
        document.getElementById("testing").innerHTML=xmlhttp5.responseText;
        }
      }
    var no_reg=document.Inputdata.no_registrasi.value;
    var nama_kelompok=document.Inputdata.nama_kelompok.value;
    var spassword_kk=document.Inputdata.password_kk.value;
    var spassword_kk2=document.Inputdata.password_kk2.value;
    var salamat_kk=document.Inputdata.alamat_kk.value;
    var sdesa_kk=document.Inputdata.desa_kk.value;
    var skecamatan_kk=document.Inputdata.kecamatan_kk.value;
    var semail_kk=document.Inputdata.email_kk.value;
    var shp_kk=document.Inputdata.hp_kk.value;
    var snama1=document.Inputdata.nama1.value; var sanggota1=document.Inputdata.anggota1.value; snuptk1=document.Inputdata.nuptk1.value;
    var snama2=document.Inputdata.nama2.value; var sanggota2=document.Inputdata.anggota2.value; snuptk2=document.Inputdata.nuptk2.value;
    var snama3=document.Inputdata.nama3.value; var sanggota3=document.Inputdata.anggota3.value; snuptk3=document.Inputdata.nuptk3.value;
    var snama4=document.Inputdata.nama4.value; var sanggota4=document.Inputdata.anggota4.value; snuptk4=document.Inputdata.nuptk4.value;
    var snama5=document.Inputdata.nama5.value; var sanggota5=document.Inputdata.anggota5.value; snuptk5=document.Inputdata.nuptk5.value;
    var snama6=document.Inputdata.nama6.value; var sanggota6=document.Inputdata.anggota6.value; snuptk6=document.Inputdata.nuptk6.value;
    var snama7=document.Inputdata.nama7.value; var sanggota7=document.Inputdata.anggota7.value; snuptk7=document.Inputdata.nuptk7.value;
    var snama8=document.Inputdata.nama8.value; var sanggota8=document.Inputdata.anggota8.value; snuptk8=document.Inputdata.nuptk8.value;
    var snama9=document.Inputdata.nama9.value; var sanggota9=document.Inputdata.anggota9.value; snuptk9=document.Inputdata.nuptk9.value;
    var snama10=document.Inputdata.nama10.value; var sanggota10=document.Inputdata.anggota10.value; snuptk10=document.Inputdata.nuptk10.value;
    var snama11=document.Inputdata.nama11.value; var sanggota11=document.Inputdata.anggota11.value; snuptk11=document.Inputdata.nuptk11.value;
    var snama12=document.Inputdata.nama12.value; var sanggota12=document.Inputdata.anggota12.value; snuptk12=document.Inputdata.nuptk12.value;
    var snama13=document.Inputdata.nama13.value; var sanggota13=document.Inputdata.anggota13.value; snuptk13=document.Inputdata.nuptk13.value;
    var snama14=document.Inputdata.nama14.value; var sanggota14=document.Inputdata.anggota14.value; snuptk14=document.Inputdata.nuptk14.value;
    var snama15=document.Inputdata.nama15.value; var sanggota15=document.Inputdata.anggota15.value; snuptk15=document.Inputdata.nuptk15.value;
    var snama16=document.Inputdata.nama16.value; var sanggota16=document.Inputdata.anggota16.value; snuptk16=document.Inputdata.nuptk16.value;
    var snama17=document.Inputdata.nama17.value; var sanggota17=document.Inputdata.anggota17.value; snuptk17=document.Inputdata.nuptk17.value;
    var snama18=document.Inputdata.nama18.value; var sanggota18=document.Inputdata.anggota18.value; snuptk18=document.Inputdata.nuptk18.value;
    var snama19=document.Inputdata.nama19.value; var sanggota19=document.Inputdata.anggota19.value; snuptk19=document.Inputdata.nuptk19.value;
    var snama20=document.Inputdata.nama20.value; var sanggota20=document.Inputdata.anggota20.value; snuptk20=document.Inputdata.nuptk20.value;
    var snama21=document.Inputdata.nama21.value; var sanggota21=document.Inputdata.anggota21.value; snuptk21=document.Inputdata.nuptk21.value;
    var snama22=document.Inputdata.nama22.value; var sanggota22=document.Inputdata.anggota22.value; snuptk22=document.Inputdata.nuptk22.value;
    var snama23=document.Inputdata.nama23.value; var sanggota23=document.Inputdata.anggota23.value; snuptk23=document.Inputdata.nuptk23.value;
    var snama24=document.Inputdata.nama24.value; var sanggota24=document.Inputdata.anggota24.value; snuptk24=document.Inputdata.nuptk24.value;
    var snama25=document.Inputdata.nama25.value; var sanggota25=document.Inputdata.anggota25.value; snuptk25=document.Inputdata.nuptk25.value;
    var jml_anggota=document.Inputdata.jumlah_anggota.value;
    var no_registrasi=no_reg.substring(12,15);
    var kode_kota=no_reg.substring(3,5);
    var tipe_daerah=document.Inputdata.tipe_daerah_kk.value;
    var nama_bank_kk = document.Inputdata.bank_kk.value;
    var srek_kk = document.Inputdata.rek_kk.value;
    var snama_rek_kk = document.Inputdata.nama_rek_kk.value;
    var ssk_kk = document.Inputdata.sk_kk.value;
    var stgl_sk = document.Inputdata.tgl_sk.value;
    sjumlah_anggota = document.Inputdata.jumlah_anggota.value;
    var ijml = parseInt(sjumlah_anggota);
    
    var passing="savedb.php?status="+str+"&no_reg="+no_reg+"&nama_kelompok="+nama_kelompok+"&password_kk="+spassword_kk+"&spassword_kk2="+spassword_kk2;
    passing=passing+"&salamat_kk="+salamat_kk+"&sdesa_kk="+sdesa_kk+"&skecamatan_kk="+skecamatan_kk+"&semail_kk="+semail_kk+"&shp_kk="+shp_kk;
    passing=passing+"&snama1="+snama1+"&sanggota1="+sanggota1+"&snuptk1="+snuptk1;
    passing=passing+"&snama2="+snama2+"&sanggota2="+sanggota2+"&snuptk2="+snuptk2;
    passing=passing+"&snama3="+snama3+"&sanggota3="+sanggota3+"&snuptk3="+snuptk3;
    passing=passing+"&snama4="+snama4+"&sanggota4="+sanggota4+"&snuptk4="+snuptk4;
    passing=passing+"&snama5="+snama5+"&sanggota5="+sanggota5+"&snuptk5="+snuptk5;
    passing=passing+"&snama6="+snama6+"&sanggota6="+sanggota6+"&snuptk6="+snuptk6;
    passing=passing+"&snama7="+snama7+"&sanggota7="+sanggota7+"&snuptk7="+snuptk7;
    passing=passing+"&snama8="+snama8+"&sanggota8="+sanggota8+"&snuptk8="+snuptk8;
    passing=passing+"&snama9="+snama9+"&sanggota9="+sanggota9+"&snuptk9="+snuptk9;
    passing=passing+"&snama10="+snama10+"&sanggota10="+sanggota10+"&snuptk10="+snuptk10;
    passing=passing+"&snama11="+snama11+"&sanggota11="+sanggota11+"&snuptk11="+snuptk11;
    passing=passing+"&snama12="+snama12+"&sanggota12="+sanggota12+"&snuptk12="+snuptk12;
    passing=passing+"&snama13="+snama13+"&sanggota13="+sanggota13+"&snuptk13="+snuptk13;
    passing=passing+"&snama14="+snama14+"&sanggota14="+sanggota14+"&snuptk14="+snuptk14;
    passing=passing+"&snama15="+snama15+"&sanggota15="+sanggota15+"&snuptk15="+snuptk15;
    passing=passing+"&snama16="+snama16+"&sanggota16="+sanggota16+"&snuptk16="+snuptk16;
    passing=passing+"&snama17="+snama17+"&sanggota17="+sanggota17+"&snuptk17="+snuptk17;
    passing=passing+"&snama18="+snama18+"&sanggota18="+sanggota18+"&snuptk18="+snuptk18;
    passing=passing+"&snama19="+snama19+"&sanggota19="+sanggota19+"&snuptk19="+snuptk19;
    passing=passing+"&snama20="+snama20+"&sanggota20="+sanggota20+"&snuptk20="+snuptk20;
    passing=passing+"&snama21="+snama21+"&sanggota21="+sanggota21+"&snuptk21="+snuptk21;
    passing=passing+"&snama22="+snama22+"&sanggota22="+sanggota22+"&snuptk22="+snuptk22;
    passing=passing+"&snama23="+snama23+"&sanggota23="+sanggota23+"&snuptk23="+snuptk23;
    passing=passing+"&snama24="+snama24+"&sanggota24="+sanggota24+"&snuptk24="+snuptk24;
    passing=passing+"&snama25="+snama25+"&sanggota25="+sanggota25+"&snuptk25="+snuptk25+"&jml_anggota="+jml_anggota+"&no_registrasi="+no_registrasi+"&kode_kota="+kode_kota;
    passing=passing+"&tipe_daerah="+tipe_daerah+"&nama_bank="+nama_bank_kk+"&no_rek_bank="+srek_kk+"&snama_rek="+snama_rek_kk+"&kk_sk="+ssk_kk+"&sk_stgl="+stgl_sk;
    var kelengkapan=1;
    if((no_reg.substring(0,2) == "XX") || (no_reg.substring(3,5) == "XX") || (no_reg.substring(6,7) == "X") || (no_reg.substring(8,11) == "XXX") || (no_reg.substring(12,15) == "XXX"))
    	kelengkapan=0;
    if((nama_kelompok=="") || (salamat_kk=="") || (tipe_daerah=="") || (sdesa_kk=="") || (skecamatan_kk=="") || (semail_kk=="") || (shp_kk==""))
        kelengkapan=0;
    if((nama_bank_kk=="")||(srek_kk=="")||(snama_rek_kk=="")||(ssk_kk=="")||(stgl_sk=="")) 
        kelengkapan = 0; 
    if (ijml<15)
        kelengkapan = 0;      
    if (ijml>=15)
    {
    	if ((snama1=="")||(sanggota1=="")||(snuptk1=="")||(snama2=="")||(sanggota2=="")||(snuptk2=="")||(snama3=="")||(sanggota3=="")||(snuptk3=="")||(snama4=="")||(sanggota4=="")||(snuptk4=="")||(snama5=="")||(sanggota5=="")||(snuptk5==""))
    	    kelengkapan = 0;
    	if ((snama6=="")||(sanggota6=="")||(snuptk6=="")||(snama7=="")||(sanggota7=="")||(snuptk7=="")||(snama8=="")||(sanggota8=="")||(snuptk8=="")||(snama9=="")||(sanggota9=="")||(snuptk9=="")||(snama10=="")||(sanggota10=="")||(snuptk10==""))
    	    kelengkapan = 0;
    	if ((snama11=="")||(sanggota11=="")||(snuptk11=="")||(snama12=="")||(sanggota12=="")||(snuptk12=="")||(snama13=="")||(sanggota13=="")||(snuptk13=="")||(snama14=="")||(sanggota14=="")||(snuptk14=="")||(snama15=="")||(sanggota15=="")||(snuptk15==""))
    	    kelengkapan = 0;
    }
    if (ijml>=16)
    {
    	if ((snama16=="")||(sanggota16=="")||(snuptk16==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=17)
    {
    	if ((snama17=="")||(sanggota17=="")||(snuptk17==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=18)
    {
    	if ((snama18=="")||(sanggota18=="")||(snuptk18==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=19)
    {
    	if ((snama19=="")||(sanggota19=="")||(snuptk19==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=20)
    {
    	if ((snama20=="")||(sanggota20=="")||(snuptk20==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=21)
    {
    	if ((snama21=="")||(sanggota21=="")||(snuptk21==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=22)
    {
    	if ((snama22=="")||(sanggota22=="")||(snuptk22==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=23)
    {
    	if ((snama23=="")||(sanggota23=="")||(snuptk23==""))
    	    kelengkapan = 0;    	
    }
    if (ijml>=24)
    {
    	if ((snama24=="")||(sanggota24=="")||(snuptk24==""))
    	    kelengkapan = 0;    	
    }
    if (ijml==25)
    {
    	if ((snama25=="")||(sanggota25=="")||(snuptk25==""))
    	    kelengkapan = 0;    	
    }
    //alert(no_reg.substring(0,2));
    if((spassword_kk==spassword_kk2) && (spassword_kk!="") && (str == "save") && (kelengkapan == 1))
    {    
        //alert(passing);
	xmlhttp5.open("GET",passing,true);
        xmlhttp5.send();
	//if(str=="save")
	//    alert("Data telah berhasil disimpan, informasi pendaftaran telah dikirimkan ke alamat email "+semail_kk);
    	//window.location='#';
        oInterval2=window.setInterval("show_status_penyimpanan()", 1000);
    }
    else if ((str=="save")&& (kelengkapan == 0))
    {
        alert("Password yang anda masukkan tidak cocok, atau data belum lengkap");
	xmlhttp5.open("GET","savedb.php?status=error",true);
        xmlhttp5.send();        
    	window.location='#';
    }
    else if(str=="init")
    {
        xmlhttp5.open("GET","savedb.php?status=init",true);
        xmlhttp5.send();
    }
    //parent.location="savedb.php?status="+str+"&q=abc"+"&nama="+nama_kelompok;
    //setTimeout("alert(document.cookie)",5000);
    //alert(document.cookie);
    //setCookie("status","processing",1);
    //datanya=getCookie("status");

    /*while(datanya=="processing")
    {
        datanya=getCookie("status");
    }*/
    //alert("abced");
}
function showlistanggota(str)
{
    ijumlah = parseInt(str);
    document.Inputdata.anggota1.value="1";
    {document.Inputdata.nama1.readOnly=true;document.Inputdata.nuptk1.readOnly=true;document.Inputdata.anggota1.disabled=true;}
    {document.Inputdata.nama2.readOnly=true;document.Inputdata.nuptk2.readOnly=true;document.Inputdata.anggota2.disabled=true;}
    {document.Inputdata.nama3.readOnly=true;document.Inputdata.nuptk3.readOnly=true;document.Inputdata.anggota3.disabled=true;}
    {document.Inputdata.nama4.readOnly=true;document.Inputdata.nuptk4.readOnly=true;document.Inputdata.anggota4.disabled=true;}
    {document.Inputdata.nama5.readOnly=true;document.Inputdata.nuptk5.readOnly=true;document.Inputdata.anggota5.disabled=true;}
    {document.Inputdata.nama6.readOnly=true;document.Inputdata.nuptk6.readOnly=true;document.Inputdata.anggota6.disabled=true;}
    {document.Inputdata.nama7.readOnly=true;document.Inputdata.nuptk7.readOnly=true;document.Inputdata.anggota7.disabled=true;}
    {document.Inputdata.nama8.readOnly=true;document.Inputdata.nuptk8.readOnly=true;document.Inputdata.anggota8.disabled=true;}
    {document.Inputdata.nama9.readOnly=true;document.Inputdata.nuptk9.readOnly=true;document.Inputdata.anggota9.disabled=true;}
    {document.Inputdata.nama10.readOnly=true;document.Inputdata.nuptk10.readOnly=true;document.Inputdata.anggota10.disabled=true;}
    {document.Inputdata.nama11.readOnly=true;document.Inputdata.nuptk11.readOnly=true;document.Inputdata.anggota11.disabled=true;}
    {document.Inputdata.nama12.readOnly=true;document.Inputdata.nuptk12.readOnly=true;document.Inputdata.anggota12.disabled=true;}
    {document.Inputdata.nama13.readOnly=true;document.Inputdata.nuptk13.readOnly=true;document.Inputdata.anggota13.disabled=true;}
    {document.Inputdata.nama14.readOnly=true;document.Inputdata.nuptk14.readOnly=true;document.Inputdata.anggota14.disabled=true;}
    {document.Inputdata.nama15.readOnly=true;document.Inputdata.nuptk15.readOnly=true;document.Inputdata.anggota15.disabled=true;}
    {document.Inputdata.nama16.readOnly=true;document.Inputdata.nuptk16.readOnly=true;document.Inputdata.anggota16.disabled=true;}
    {document.Inputdata.nama17.readOnly=true;document.Inputdata.nuptk17.readOnly=true;document.Inputdata.anggota17.disabled=true;}
    {document.Inputdata.nama18.readOnly=true;document.Inputdata.nuptk18.readOnly=true;document.Inputdata.anggota18.disabled=true;}
    {document.Inputdata.nama19.readOnly=true;document.Inputdata.nuptk19.readOnly=true;document.Inputdata.anggota19.disabled=true;}
    {document.Inputdata.nama20.readOnly=true;document.Inputdata.nuptk20.readOnly=true;document.Inputdata.anggota20.disabled=true;}
    {document.Inputdata.nama21.readOnly=true;document.Inputdata.nuptk21.readOnly=true;document.Inputdata.anggota21.disabled=true;}
    {document.Inputdata.nama22.readOnly=true;document.Inputdata.nuptk22.readOnly=true;document.Inputdata.anggota22.disabled=true;}
    {document.Inputdata.nama23.readOnly=true;document.Inputdata.nuptk23.readOnly=true;document.Inputdata.anggota23.disabled=true;}
    {document.Inputdata.nama24.readOnly=true;document.Inputdata.nuptk24.readOnly=true;document.Inputdata.anggota24.disabled=true;}
    {document.Inputdata.nama25.readOnly=true;document.Inputdata.nuptk25.readOnly=true;document.Inputdata.anggota25.disabled=true;}
    if(ijumlah>=1)    
	{document.Inputdata.nama1. readOnly=false;document.Inputdata.nuptk1. readOnly=false;}
    if(ijumlah>=2)          
	{document.Inputdata.nama2. readOnly=false;document.Inputdata.nuptk2. readOnly=false;document.Inputdata.anggota2. disabled=false;}
    if(ijumlah>=3)      
	{document.Inputdata.nama3. readOnly=false;document.Inputdata.nuptk3. readOnly=false;document.Inputdata.anggota3. disabled=false;}
    if(ijumlah>=4)            
	{document.Inputdata.nama4. readOnly=false;document.Inputdata.nuptk4. readOnly=false;document.Inputdata.anggota4. disabled=false;}
    if(ijumlah>=5)               
	{document.Inputdata.nama5. readOnly=false;document.Inputdata.nuptk5. readOnly=false;document.Inputdata.anggota5. disabled=false;}
    if(ijumlah>=6)                
	{document.Inputdata.nama6. readOnly=false;document.Inputdata.nuptk6. readOnly=false;document.Inputdata.anggota6. disabled=false;}
    if(ijumlah>=7)          
	{document.Inputdata.nama7. readOnly=false;document.Inputdata.nuptk7. readOnly=false;document.Inputdata.anggota7. disabled=false;}
    if(ijumlah>=8)   
	{document.Inputdata.nama8. readOnly=false;document.Inputdata.nuptk8. readOnly=false;document.Inputdata.anggota8. disabled=false;}
    if(ijumlah>=9)                  
	{document.Inputdata.nama9. readOnly=false;document.Inputdata.nuptk9. readOnly=false;document.Inputdata.anggota9. disabled=false;}
    if(ijumlah>=10)               
	{document.Inputdata.nama10.readOnly=false;document.Inputdata.nuptk10.readOnly=false;document.Inputdata.anggota10.disabled=false;}
    if(ijumlah>=11)                   
	{document.Inputdata.nama11.readOnly=false;document.Inputdata.nuptk11.readOnly=false;document.Inputdata.anggota11.disabled=false;}
    if(ijumlah>=12)               
	{document.Inputdata.nama12.readOnly=false;document.Inputdata.nuptk12.readOnly=false;document.Inputdata.anggota12.disabled=false;}
    if(ijumlah>=13)                   
	{document.Inputdata.nama13.readOnly=false;document.Inputdata.nuptk13.readOnly=false;document.Inputdata.anggota13.disabled=false;}
    if(ijumlah>=14)                
	{document.Inputdata.nama14.readOnly=false;document.Inputdata.nuptk14.readOnly=false;document.Inputdata.anggota14.disabled=false;}
    if(ijumlah>=15)                  
	{document.Inputdata.nama15.readOnly=false;document.Inputdata.nuptk15.readOnly=false;document.Inputdata.anggota15.disabled=false;}
    if(ijumlah>=16)                    
	{document.Inputdata.nama16.readOnly=false;document.Inputdata.nuptk16.readOnly=false;document.Inputdata.anggota16.disabled=false;}
    if(ijumlah>=17)                
	{document.Inputdata.nama17.readOnly=false;document.Inputdata.nuptk17.readOnly=false;document.Inputdata.anggota17.disabled=false;}
    if(ijumlah>=18)                    
	{document.Inputdata.nama18.readOnly=false;document.Inputdata.nuptk18.readOnly=false;document.Inputdata.anggota18.disabled=false;}
    if(ijumlah>=19)              
	{document.Inputdata.nama19.readOnly=false;document.Inputdata.nuptk19.readOnly=false;document.Inputdata.anggota19.disabled=false;}
    if(ijumlah>=20)                  
	{document.Inputdata.nama20.readOnly=false;document.Inputdata.nuptk20.readOnly=false;document.Inputdata.anggota20.disabled=false;}
    if(ijumlah>=21)                 
	{document.Inputdata.nama21.readOnly=false;document.Inputdata.nuptk21.readOnly=false;document.Inputdata.anggota21.disabled=false;}
    if(ijumlah>=22)                   
	{document.Inputdata.nama22.readOnly=false;document.Inputdata.nuptk22.readOnly=false;document.Inputdata.anggota22.disabled=false;}
    if(ijumlah>=23)                  
	{document.Inputdata.nama23.readOnly=false;document.Inputdata.nuptk23.readOnly=false;document.Inputdata.anggota23.disabled=false;}
    if(ijumlah>=24) 
	{document.Inputdata.nama24.readOnly=false;document.Inputdata.nuptk24.readOnly=false;document.Inputdata.anggota24.disabled=false;}
    if(ijumlah>=25) 
	{document.Inputdata.nama25.readOnly=false;document.Inputdata.nuptk25.readOnly=false;document.Inputdata.anggota25.disabled=false;}
    
    //window.alert(str);
   //ChangeNoReg_updatelist("XX")

}
function update_retprop(str)
{
    var data,data1;
    data=document.Inputdata.no_registrasi.value;
    data = data.substring(2,15);
    document.Inputdata.no_registrasi.value = str + data;
}
function update_noreg(str)
{
    var data,data1;
    //update list kk
    var sprop=document.Inputdata.propinsi.value;
    if (sprop=="XX")
        sprop="";
    var skab=document.Inputdata.combo_kota.value;
    if(skab=="XX")
        skab="";
    var skk=document.Inputdata.combo_kk.value;
        if(skk=="XX")
        skk="";
    //7okt12showrekapnasional(sprop,skab,skk);
    /*data= document.Inputdata.no_registrasi.value;
    data1=document.Inputdata.no_registrasi.value;
    data = data.substring(0,3);
    data1 = data1.substring(5,15);
    document.Inputdata.no_registrasi.value = data + str + data1;
    data = document.Inputdata.no_registrasi.value;
    //disini setelah memilih kota
    update_no_urut(data);
    data = document.Inputdata.no_registrasi.value;
    data = data.substring(0,12)+'XXX';
    document.Inputdata.no_registrasi.value=data;*/
    showlistkecamatan("11");
}
function update_no_reg2()
{
    var str,noreg_u;
    str=getCookie("IDurut");
    if (str>"000")
    {
        //alert(str);
	noreg_u = document.Inputdata.no_registrasi.value;
	noreg_u = noreg_u.substring(0,12);
	str = noreg_u + str;
        document.Inputdata.no_registrasi.value = str;
	window.clearInterval(oInterval);
	setCookie("IDurut","000",1);
    }
}
function update_kk_reg(str)
{
    var data,data1;
    /*data=document.Inputdata.no_registrasi.value;
    data1=document.Inputdata.no_registrasi.value;
    data = data.substring(0,6);
    data1 = data1.substring(7,15);
    document.Inputdata.no_registrasi.value = data + str + data1;*/
    var sprop=document.Inputdata.propinsi.value;
    if (sprop=="XX")
        sprop="";
    var skab=document.Inputdata.combo_kota.value;
    if(skab=="XX")
        skab="";
    var skk=document.Inputdata.combo_kk.value;
        if(skk=="XX")
        skk="";
    if (istartup!=1)
    {
        desrekapnas();
        setTimeout('showrekapnasional("'+sprop+'","'+skab+'","'+skk+'")',1000);;
		}
}
function update_bidang(str)
{
    //XX-XX-X-XXX-001	
    var data,data1;
    data=document.Inputdata.no_registrasi.value;
    data1=document.Inputdata.no_registrasi.value;
    data = data.substring(0,8);
    data1 = data1.substring(11,15);
    document.Inputdata.no_registrasi.value = data + str + data1;
}
function update_no_urut(str)
{
    //window.alert(str);
    if (str.length==0)
      {
      document.getElementById("siluman").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp4=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp4=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp4.onreadystatechange=function()
      {
      if (xmlhttp4.readyState==4 && xmlhttp4.status==200)
        {
        document.getElementById("siluman").innerHTML=xmlhttp4.responseText;
        }
      }
     xmlhttp4.open("GET","hitung_no.php?q="+str,true);
     xmlhttp4.send();
     oInterval=window.setInterval("update_no_reg2()", 1000);
    //ChangeNoReg_updatelist("XX")
}
function kosongi_noreg()
{
    //XX-XX-X-XXX-001	
    var data,data1;
    //alert("fdsafsa");
    data1=document.Inputdata.no_registrasi.value;
    //alert(data1);
    data = 'XX-XX-X-XXX-XXX';
    data1 = data1.substring(12,15);
    document.Inputdata.no_registrasi.value = data;// + data1;
    
}
function showtabelanggota(str)
{
    //window.alert(str);
    if (str.length==0)
      {
      document.getElementById("tampilanggota").innerHTML="";
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp3=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp3=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp3.onreadystatechange=function()
      {
      if (xmlhttp3.readyState==4 && xmlhttp3.status==200)
        {
        document.getElementById("tampilanggota").innerHTML=xmlhttp3.responseText;
        }
      }
    if(str!='X')
    {
        xmlhttp3.open("GET","tampil_data.php?anggota="+str,true);
        xmlhttp3.send();
    }
    else
        window.location='ptampil_data.php';
    //ChangeNoReg_updatelist("XX")

}
function CreateExcelSheet(str)
{
    var snuptk='<?php echo $nuptk ?>';
    var sses_type = '<?php echo $ses_type?>';
    if (snuptk=="admin" || sses_type=="ADM")
    {
        //alert("Fitur ini belum di aktifkan...");
        var tbData=document.getElementById("data_table");
        //var strData = tbData.rows[6].cells[1].childNodes[0].data;
        var rowcount = tbData.rows.length;
        var passing="";
        var irow=0;
        var sdata;
        var rowcount2=rowcount-2;
        passing=passing+"?rowcount="+rowcount2;
        for(irow=2;irow<rowcount;irow++)
        {
            passing=passing+'&no_reg'+(irow-1)+'='+tbData.rows[irow].cells[1].childNodes[0].data;
        }
        if(rowcount<=300 || str=="all")
        {
      /*      //alert(passing);
            //Ajax
            if (window.XMLHttpRequest)
            {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp8=new XMLHttpRequest();
            }
            else
            {// code for IE6, IE5
                xmlhttp8=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp8.onreadystatechange=function()
            {
                if (xmlhttp8.readyState==4 && xmlhttp8.status==200)
                {
                    document.getElementById("excelmessage").innerHTML=xmlhttp8.responseText;
                }
            }
            if(str=="filter")
            {
                passing=passing+"&req="+str;
                alert(passing);
                xmlhttp8.open("GET","export_excel.php"+passing,true);
            }
            else
                xmlhttp8.open("GET","export_excel.php"+"&req="+str,true);               
            xmlhttp8.send();
      */
            if(str=="filter")
            {
                passing=passing+"&req="+str;
                window.location="export_excel.php"+passing;
            }
            else
                window.location="export_excel.php?req="+str;                
        }
        else
        {
            alert("Jumlah baris yang dapat simpan dalam tabel excel maksimum 300 baris");
        }
    }
    else
        alert("Maaf, fitur ini hanya dapat diaplikasikan oleh administrator");           
}
function tampil_kecamatan(str)
{
	var sprop = document.Inputdata.propinsi.value;
	var skab = document.Inputdata.combo_kota.value;
	var skk = document.Inputdata.combo_kk.value;
	if (istartup!=1)
  {
    desrekapnas();
    setTimeout('showrekapnasional("'+sprop+'","'+skab+'","'+skk+'")',1000);;
  }
}
function PilihSemua()
{
    //alert("masuk");
    var snuptk='<?php echo $nuptk ?>';
    var sses_type = '<?php echo $ses_type?>';
    if (snuptk=="admin" || sses_type=="ADM")
    {
        var mytable = document.getElementsByTagName("table")[1];
        var rowCount = mytable.rows.length;
        var colCount = mytable.getElementsByTagName("tr")[0].getElementsByTagName("td").length;
        var arropt  = document.Inputdata.elements["option_table[]"];
        var i=0;
        for(i=0;i<rowCount-2;i++)
            arropt[i].checked = true;
    }
    else
        alert("Maaf, fitur ini hanya dapat diaplikasikan oleh administrator");
    //alert(rowCount);
}
function ResetPilihan()
{
    var snuptk='<?php echo $nuptk ?>';
    var sses_type = '<?php echo $ses_type?>';
    if (snuptk=="admin" || sses_type=="ADM")
    {
        //alert("masuk");
        var mytable = document.getElementsByTagName("table")[1];
        var rowCount = mytable.rows.length;
        var colCount = mytable.getElementsByTagName("tr")[0].getElementsByTagName("td").length;
        var arropt  = document.Inputdata.elements["option_table[]"];
        var i=0;
        for(i=0;i<rowCount-2;i++)
            arropt[i].checked = false;
    }
    else
        alert("Maaf, fitur ini hanya dapat diaplikasikan oleh administrator");
    
    //alert(rowCount);
}
function FilterTable()
{
    var snuptk='<?php echo $nuptk ?>';
    var sses_type = '<?php echo $ses_type?>';
    if (snuptk=="admin" || sses_type=="ADM")
    {
        try 
        {
            var table = document.getElementById('data_table');
            var rowCount = table.rows.length;
            for(var i=2; i<rowCount; i++) 
            {            

                if(null != document.Inputdata.elements["option_table[]"][i-2] && false == document.Inputdata.elements["option_table[]"][i-2].checked) 
                {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
        
            }
        }
        catch(e) 
        {
            alert(e);
        } 
    }
    else
        alert("Maaf, fitur ini hanya dapat diaplikasikan oleh administrator");
}
function fcheckStatTab()
{
    if(document.Inputdata.checkboxnull !== undefined)
    {
        window.clearInterval(oInterval7);
        document.Inputdata.loading_logo.src="images/blank.gif";
        istartup=0;
    }
}
function fcheck_kolom()
{
    var ck_cc2=getCookie("ck_cc2")
    if (ck_cc2=="on" || typeof ck_cc2 ==="undefined")
    {
        document.frm_kolom.cc2.checked=true;
    	setCookie("ck_cc2","on",1000);
    }
    var ck_cc3=getCookie("ck_cc3")
    if (ck_cc3=="on" || typeof ck_cc3 ==="undefined")
    {
        document.frm_kolom.cc3.checked=true;
    	setCookie("ck_cc3","on",1000);
    }
    var ck_cc4=getCookie("ck_cc4")
    if (ck_cc4=="on" || typeof ck_cc4 ==="undefined")
    {
        document.frm_kolom.cc4.checked=true;
    	setCookie("ck_cc4","on",1000);
    }
    var ck_cc5=getCookie("ck_cc5")
    if (ck_cc5=="on" || typeof ck_cc5 ==="undefined")
    {
        document.frm_kolom.cc5.checked=true;
    	setCookie("ck_cc5","on",1000);
    }
    var ck_cc6=getCookie("ck_cc6")
    if (ck_cc6=="on" || typeof ck_cc6 ==="undefined")
    {
        document.frm_kolom.cc6.checked=true;
    	setCookie("ck_cc6","on",1000);
    }
    var ck_cc7=getCookie("ck_cc7")
    if (ck_cc7=="on" || typeof ck_cc7 ==="undefined")
    {
        document.frm_kolom.cc7.checked=true;
    	setCookie("ck_cc7","on",1000);
    }
    var ck_cc8=getCookie("ck_cc8")
    if (ck_cc8=="on" || typeof ck_cc8 ==="undefined")
    {
        document.frm_kolom.cc8.checked=true;
    	setCookie("ck_cc8","on",1000);
    }
    var ck_cc9=getCookie("ck_cc9")
    if (ck_cc9=="on" || typeof ck_cc9 ==="undefined")
    {
        document.frm_kolom.cc9.checked=true;
    	setCookie("ck_cc9","on",1000);
    }
    var ck_cc10=getCookie("ck_cc10")
    if (ck_cc10=="on" || typeof ck_cc10 ==="undefined")
    {
        document.frm_kolom.cc10.checked=true;
    	setCookie("ck_cc10","on",1000);
    }
    var ck_cc11=getCookie("ck_cc11")
    if (ck_cc11=="on" || typeof ck_cc11 ==="undefined")
    {
        document.frm_kolom.cc11.checked=true;
    	setCookie("ck_cc11","on",1000);
    }
}
function fcancel()
{
	//window.location="showlistdata.php";
	window.location='showlistdata.php?tipe_kk='+document.Inputdata.combo_kk.value+'&kab='+document.Inputdata.combo_kota.value+'&prop='+document.Inputdata.propinsi.value;	
}
function fprocess()
{
	//window.location="showlistdata.php";
	if (document.frm_kolom.cc2.checked==true)
		setCookie("ck_cc2","on",1000);
	else
		setCookie("ck_cc2","off",1000);
	if (document.frm_kolom.cc3.checked==true)
		setCookie("ck_cc3","on",1000);
	else
		setCookie("ck_cc3","off",1000);
	if (document.frm_kolom.cc4.checked==true)
		setCookie("ck_cc4","on",1000);
	else
		setCookie("ck_cc4","off",1000);
	if (document.frm_kolom.cc5.checked==true)
		setCookie("ck_cc5","on",1000);
	else
		setCookie("ck_cc5","off",1000);
	if (document.frm_kolom.cc6.checked==true)
		setCookie("ck_cc6","on",1000);
	else
		setCookie("ck_cc6","off",1000);
	if (document.frm_kolom.cc7.checked==true)
		setCookie("ck_cc7","on",1000);
	else
		setCookie("ck_cc7","off",1000);
	if (document.frm_kolom.cc8.checked==true)
		setCookie("ck_cc8","on",1000);
	else
		setCookie("ck_cc8","off",1000);
	if (document.frm_kolom.cc9.checked==true)
		setCookie("ck_cc9","on",1000);
	else
		setCookie("ck_cc9","off",1000);
	if (document.frm_kolom.cc10.checked==true)
		setCookie("ck_cc10","on",1000);
	else
		setCookie("ck_cc10","off",1000);
	if (document.frm_kolom.cc11.checked==true)
		setCookie("ck_cc11","on",1000);
	else
		setCookie("ck_cc11","off",1000);
	window.location='showlistdata.php?tipe_kk='+document.Inputdata.combo_kk.value+'&kab='+document.Inputdata.combo_kota.value+'&prop='+document.Inputdata.propinsi.value;	
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<title>PROFIL KKG/MGMP, KKKS/MKKS, KKPS/MKPS</title>
    
<link rel="stylesheet" type="text/css" href="css/style-min.css" />
<link rel="stylesheet" type="text/css" href="css/table-min.css" />
<link rel="stylesheet" type="text/css" href="css/menu-min.css" />

<script type="text/javascript" src="script/libs_c.js"></script>
<!--<script type="text/javascript" src="script/default.js"></script>-->
<script type="text/javascript" language="javascript" src="script/script.js"></script>

<!--Jquery-->
<!-- Page styles -->
<!-- Contact Form CSS files -->
<link type='text/css' href='css/contact.css' rel='stylesheet' media='screen' />

<!-- Load JavaScript files -->
<script type='text/javascript' src='script/jquery.js'></script>
<script type='text/javascript' src='script/jquery.simplemodal.js'></script>
<script type='text/javascript' src='script/contact.js'></script></head>
<!--Jquery -->

<!--[if IE]-->
<style type="text/css">
/* 50 = ti_m padding + margin */
#t_o { width: expression((document.getElementById('ti_m').offsetWidth + 50) > document.documentElement.offsetWidth ? document.documentElement.scrollWidth : ''); }
#ti_m1 { border-left: 0; }
#t_m .linfo, #t_m .rinfo { line-height: 1.6em; }
.toolbar fieldset { padding-bottom: 2px; }
input.button { padding: 0 8px; }
h3 { background-position: 0 1px; }
/* To prevent extra spacing under the tab */
div.tab { float: none; }
</style>
<!--[endif]-->

<!--[if lte IE 6]-->
<!--<script type="text/javascript" language="javascript" src="script/cssmenu.js"></script>-->
<style type="text/css">
img {
	behavior: url("imanges/pngbehavior.htc"); /* Must be absolute path */
}
</style>
<!--[endif]-->



<!-- module IE css -->

<style>
im { cursor:pointer;}
</style>

<link rel="shortcut icon" href="images/diknas-ico.png" />

</head>

<body>
	<div id="t_o">
			
		<im><div id="t_h" OnClick="window.location=('http://psdmp.kemdiknas.go.id')">
			<div class="w0">
				<div class="w1">
					<div id="logo"><img alt="makara" src="images/diknas.png" style="width:42px;height:42px"/></div>
					<h1><em>KEMENTERIAN PENDIDIKAN DAN KEBUDAYAAN</em></h1>
					<!--<h2><br>PROFIL KKG/MGMP, KKKS/MKKS, KKPS/MKPS</br></h2>
					<h2> <em>Kementerian Pendidikan dan Kebudayaan</em> </h2>-->

					<!--<div class="lang icons">
						Language: &nbsp;
																					<span class="currentlang" title="Current language"><img src="images/id.png" /></span>
																					<a href="../System/Language?lang=en"><img src="images/en.png" /></a>
														 |
						zoom <select onchange="zoom(this)"><option value="100">100%</option><option value="110">110%</option><option value="120">120%</option><option value="140">140%</option><option value="150">150%</option></select>

					</div>-->
				</div>
			</div>
		</div></im>

		<div id="t_m">
			<div class="w0">
				<div class="w1">
					<ul id="nv">
					    <li class="static"><a href="#">&gt;&gt;</a></li>
					    <li><a href="lihat_data.php">Home</a></li>
					    <li class="class hc"><a href="#">Atur Data</a>
					        <ul>
					            <li class="last"><a href="lihat_data.php">Isi / edit Data Kelompok Kerja</a></li>
					            <li class="last"><a href="view.php?reg=<?php echo $reg_no ?>">Lihat Data Kelompok Kerja</a></li>
					            <?php echo $additional_menu?>
					        </ul>
					    </li>
					    <li class="class hc"><a href="ptampil_data.php">Laporan</a>
					        <ul>
					            <li><a href="ptampil_data.php">Rekapitulasi Data Kelompok Kerja</a></li>
					            <li class="last"><a href="showlistdata.php">Daftar Kelompok Kerja</a></li>
					         </ul>
					     </li>
					     <li class="class hc"></li></ul></li>
					 </ul>

					<div style="border-top:2px solid gold;border-bottom:1px solid #C90"><!-- --></div>
					<div id="m_b">
						<div id="m_b1">
							<div class="linfo" style="border-left:0">
								 <br/>
								<strong>
																<a href="" title="Detail"><img style="vertical-align:bottom" src="images/role2.png" class="png16" alt="person"/></a>
																<a href="" title="Ganti Role"></a> 
								User Login &ndash; <?php echo ' '.$nama_kk?></strong>  

							</div>
							<div class="linfo" style="border-right:0">
								 <a href="logout.php"><img src="<?php echo $img_log?>" /></a>
							</div>
							
							<div class="rinfo" style="font:1.4em calibri;letter-spacing:-1px">
								<!--Logout Counter <span id="ss_min">30</span>:<span id="ss_sec">00</span>--> </a><strong>Jumlah Kelompok Kerja Terdaftar : <?php echo $jumlah_total_kk ?></strong>
							</div>

							
							<div class="clear"><!-- --></div>

							<div style="border-bottom:1px solid #DDD"><!-- --></div>
							<h2 id="ti_h">Daftar Data Kelompok Kerja KKG/MGMP, KKKS/MKKS, KKPS/MKPS</h2>
							<div id="ti_m">
								<div id="ti_m1">
							<div class="clear"></div>

<div class="clear">&nbsp;</div>

<form action="kirimpos.php" method="post" name="Inputdata">
        <!--<script type="text/javascript" > showlistbidang("XX"); </script>-->

	<input type="hidden" name="KD_MHS" value="" />
	<table class="box" width="100%">
		<tr>
			<th colspan="2">FILTER DATA KELOMPOK KERJA</th>
		</tr>
		<tr>
		    <td class="head" width="15%">Propinsi</td>
		    <td width="85%"><p id="listpropinsi"></td>
		    <!--<td width="30%">
		        <select name="kota" onchange="ChangeNoReg_updatelist(this.value)";)>
			    <option value="XX">Propinsi</option>
			    <option value="01">NAD</option>
			    <option value="02">Sumut</option>
			    <option value="03">Riau</option>
			    <option value="04">Sumbar</option>
			    <option value="05">Jambi</option>
			</select>
		     </td>
		    <td class="head" width="20%"></td>
		    <td class="head" width="20%"></td>-->
		</tr>
		<tr>
		    <td class="head" width="15%">Kabupaten / Kota</td>
		    <td width="85%"><p id="listkota2"></td>

		    <!--<td width="30%">
		        <select name="kd_pend_terakhir" onchange="showlistkota(this.value);">
			    <option value="">Kabupaten / Kota</option>
			    <option value="1">Bogor</option>
			    <option value="2">Kota Depok</option>
			    <option value="3">Cianjur</option>
			    <option value="4">Bandung</option>
			    <option value="5">Kota Bandung</option>
			</select>
		     </td>
		    <td class="head" width="20%"></td>
		    <td class="head" width="20%"></td>-->
		</tr>
		<tr>
		    <td class="head" width="15%">Kecamatan</td>
		    <td width="85%"><p id="listkecamatan"></td>

		    <!--<td width="30%">
		        <select name="kd_pend_terakhir" onchange="showlistkota(this.value);">
			    <option value="">Kabupaten / Kota</option>
			    <option value="1">Bogor</option>
			    <option value="2">Kota Depok</option>
			    <option value="3">Cianjur</option>
			    <option value="4">Bandung</option>
			    <option value="5">Kota Bandung</option>
			</select>
		     </td>
		    <td class="head" width="20%"></td>
		    <td class="head" width="20%"></td>-->
		</tr>
		<tr>
		    <td class="head" width="15%">Tipe Daerah Kelompok Kerja</td>
		    <td width="85%"><p>
		        <select name="combo_tipe_daerah" onchange="update_kk_reg(this.value)">
			    <option value="">Pilih salah satu</option>
			    <option value="1">Perkotaan</option>
			    <option value="2">Pedesaan</option>
			    <option value="3">Terpencil</option>
			    <option value="4">Perbatasan (dengan negara lain)</option>
			</select></p>
		     </td>
		    <!--<td class="head" width="20%"></td>
		    <td class="head" width="20%"></td>-->
		</tr>
		<tr>
		    <td class="head" width="15%">Jenis Kelompok Kerja</td>
		    <td width="85%"><p>
		        <select name="combo_kk" onchange="update_kk_reg(this.value)">
			    <option value="XX">Jenis Kelompok Kerja</option>
			    <option value="1">KKG</option>
			    <option value="2">MGMP</option>
			    <option value="3">KKKS</option>
			    <option value="4">MKKS</option>
			    <option value="5">KKPS</option>
			    <option value="6">MKPS</option>
			</select></p>
		     </td>
		    <!--<td class="head" width="20%"></td>
		    <td class="head" width="20%"></td>-->
		</tr>
		<tr>
			<th colspan="4">DATA KELOMPOK KERJA</th>
		</tr>
		</table>
                <p id="rekapnas"></p>       
		<table class="box" width="100%">
		<!--<input type="reset" value="Reset" />-->
	  <?php echo $button_list?>
		<img name="loading_logo" src="images/loading.gif">
	</table>
</form>
																	</div>
							</div>
						</div>
					</div>

					<div style="clear:both;border-bottom:1px solid #DDD"><!-- --></div>
					<div class="foot">
						<div style="float:left">&copy; Copyright 2011 <a href="http://psdmp.kemdiknas.go.id"_blank">Kementerian Pendidikan dan Kebudayaan</a></div>

						<div style="float:right">Sekretariat PSDMP dan PMP</div>
						<div class="clear"></div>
					</div>

				</div>
			</div>
		</div>
		<div id="t_f"><div><div>&nbsp;</div></div></div>
	</div>
	<script type="text/javascript" > showlistpropinsi("<?php echo $sprop ?>"); </script>
        <script type="text/javascript" > showlistkota("<?php echo $sprop ?>"); </script>
        <script type="text/javascript" > showlistkecamatan("<?php echo $skab ?>"); </script>
        <script type="text/javascript" > showrekapnasional("<?php echo $sprop ?>","<?php echo $skab ?>","<?php echo $skk ?>"); </script>
	<div id="siluman"></div>
	<div id="excelmessage"></div>
</body>
</html>
